import request from '@/utils/request'

// export function fetchList(parentId,params) {
//   return request({
//     url:'product/productCategory/findList/'+parentId,
//     method:'get',
//     params:params
//   })
// }
export function fetchList(params) {
  return request({
    url:'product/productAttribute/category/list',
    method:'get',
    params:params
  })
}
export function findList(data) {
  return request({
    url:'product/productCategory/findList/',
    method:'post',
    data
  })
}
export function updateNavStatus(ids, factoryStatus) {
  return request({
    url: '/product/productCategory/update/navStatus?ids=' + ids + '&factoryStatus=' + factoryStatus,
    method: 'post',
  })
}

export function updateShowStatus(ids, showStatus) {
  return request({
    url: '/product/productCategory/updateShowStatus?ids=' + ids + '&showStatus=' + showStatus,
    method: 'post'
  })
}

export function deleteProductCate(id) {
  return request({
    url:'/product/productCategory/delete/'+id,
    method:'post'
  })
}

export function createProductCate(data) {
  return request({
    url:'/product/productCategory/create',
    method:'post',
    data:data
  })
}

export function updateProductCate(id,data) {
  return request({
    url:'/product/productCategory/update/'+id,
    method:'post',
    data:data
  })
}

export function getProductCate(id) {
  return request({
    url:'/product/productCategory/'+id,
    method:'get',
  })
}

export function fetchListWithChildren() {
  return request({
    url:'/product/productCategory/list/withChildren',
    method:'get'
  })
}
